<html>
<head><meta charset="utf-8"><title>rust LLVM IR for String · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rust.20LLVM.20IR.20for.20String.html">rust LLVM IR for String</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="227040887"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rust%20LLVM%20IR%20for%20String/near/227040887" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Shihao Xia <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rust.20LLVM.20IR.20for.20String.html#227040887">(Feb 19 2021 at 22:38)</a>:</h4>
<p>%"alloc::string::String" = type { [0 x i64], %"alloc::vec::Vec&lt;u8&gt;", [0 x i64] } </p>
<p>Does anyone know what is the purpose of  [0 x i64] at the beginning and the end of the struct? And seems like this situation also is pretty common in almost for every Rust's struct....</p>



<a name="227040943"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rust%20LLVM%20IR%20for%20String/near/227040943" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rust.20LLVM.20IR.20for.20String.html#227040943">(Feb 19 2021 at 22:39)</a>:</h4>
<p>Alignment of fields.</p>



<a name="227041040"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rust%20LLVM%20IR%20for%20String/near/227041040" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rust.20LLVM.20IR.20for.20String.html#227041040">(Feb 19 2021 at 22:40)</a>:</h4>
<p>In this particular case it could be omitted, probably, but its easier to just emit it for all fields, than not to.</p>



<a name="227041137"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rust%20LLVM%20IR%20for%20String/near/227041137" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Shihao Xia <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rust.20LLVM.20IR.20for.20String.html#227041137">(Feb 19 2021 at 22:41)</a>:</h4>
<p>Make sense...thank you <span class="user-mention" data-user-id="123586">@nagisa</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>